<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <base href="/">

</head>
<style>
table th{
    color:white ;
    background-color: rgb(93, 213, 200) ;
    width: 170px ;
    height: 50px ;
    font-size: 20px;
}
table td a{
    text-decoration: none ;
}
table th,table td{
    text-align: center ;
}
</style>
<body>
{% extends "motherboard.html"%}
{% block sosuo %}
<form method="GET" action="" >
        {% csrf_token %}
    货品  <input type="text" placeholder="请输入关键字" name="anniu">
    <input id="anniu" type="submit"  value="查询" />
    </form>
{% endblock %}
{% block shop %}
<div class="panel panel-default">
        <div id="collapseTwo" class="panel-collapse collapse">
			<div class="panel-body">
                {% load static %}
				<img width="1200px" height="500px" src="{% static '/images/num.png' %}" alt="" >
			</div>
		</div>
		<div class="panel-heading">
<table border="1" class="table table-striped">
    <tr>
     <th>   <form action="" method="POST">
            {% csrf_token %}
     <button type="submit" value="上标" name="paixu">
        {% load static %}
      <img src="{% static '/images/上标.png' %}" alt=""  width="20px" height="20px">
    </button>  时间
    <button type="submit" value="下标" name="paixu">
        {% load static %}
        <img src="{% static '/images/下标.png' %}" alt="" width="20px" height="20px">
    </button>
    </form></th>
    <th>款式编码</th>
    <th>分类</th>
    <th>总销量</th>
    <th>库存</th>
    <th>操作</th>
    </tr>
    {% for line in page_obj.object_list %}
    <tr>
        <td>{{line.time|date:"Y-m-d"}}</td>
        <td>{{line.number}}</td>
        <td>{{line.cla}}</td>
        <td>{{line.sales}}</td>
        <td>{{line.tory}}</td>
    <td>
        <a href="/index1/Remove_shop/?number={{ line.number }}">移出</a>
        <a href="/index1/delete_shop/?number={{ line.number }}">删除</a>
    </td>
    </tr>
    {% endfor %}
</table>
</div>
</div>
{%if fenye %}
<ul class="pagination">
	<li><a href='?page=1&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}'>首页</a></li>
	{% if page_obj.has_previous %}
            <li><a href="?page={{ page_obj.previous_page_number }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}" >上一页</a></li>
            {# 如果上一页没有数据了，那么不让做任何操作 #}
        {% else %}
        {% endif %}

    {% if data.first %}
                    <li><a href="/index1/shop/?page=1&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}">1</a></li>
                {% endif %}
                {% if data.left %}
                    {% if data.left_s %}
                        <li><a href="#">...</a></li>
                    {% endif %}
                    {% for i in data.left %}
                        <li><a href="/index1/shop/?page={{ i }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}">{{ i }}</a></li>
                    {% endfor %}
                {% endif %}
                <li><a href="#"> {{ page_num }}</a></li>
                {% if data.right %}
                    {% for i in data.right %}
                        <li><a href="/index1/shop/?page={{ i }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}">{{ i }}</a></li>
                    {% endfor %}
                    {% if data.right_s %}
                        <li><a href="#">...</a></li>
                    {% endif %}
                {% endif %}
                {% if data.last %}
                    <li ><a href="/index1/shop/?page={{ paginator.num_pages }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}">{{ paginator.num_pages }}</a>
                    </li>
                {% endif %}

	{# 如果当前页还有下一页，那么让其可以点击进入下一页 #}
        {% if page_obj.has_next %}
            <li><a href="/index1/shop/?page={{ page_obj.next_page_number }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}" >下一页</a></li>
        {% endif %}
	{# 跳转到尾页，让page参数直接等于总页数 #}
        <li><a href='/index1/shop/?page={{ paginator.num_pages }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}'>尾页</a></li>
</ul>
{% else %}
<ul class="pagination">
        <li><a href='?page=1&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}'>首页</a></li>
        {% if page_obj.has_previous %}
                <li><a href="?page={{ page_obj.previous_page_number }}&paixu={{paixu}}" >上一页</a></li>
                {# 如果上一页没有数据了，那么不让做任何操作 #}
            {% else %}
            {% endif %}

            {% for num in paginator.page_range %}
            {# 如果循环的页码与当前查看的页码相等，那么就让其高亮显示 #}
            {% if num == news.number %}
                <li class="thisclass"><a>{{ num }}</a></li>
            {% else %}
                <li><a href="?page={{ num }}&paixu={{paixu}}" data-ey_fc35fdc="html" data-tmp="1">{{ num }}</a></li>
            {% endif %}
          {% endfor %}

        {# 如果当前页还有下一页，那么让其可以点击进入下一页 #}
            {% if page_obj.has_next %}
                <li><a href="/index1/shop/?page&paixu={{paixu}}" >下一页</a></li>
            {% endif %}
        {# 跳转到尾页，让page参数直接等于总页数 #}
            <li><a href='/index1/shop/?page={{ paginator.num_pages }}&paixu={{paixu}}'>尾页</a></li>
    </ul>
{% endif %}
{% endblock %}
</body>
</html>